

<script setup>
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const items = [[{
    label: 'logout',
    icon: 'i-heroicons-paper-airplane',
  click:()=>{
    localStorage.removeItem('token')
    localStorage.removeItem('user_id')
    localStorage.removeItem('username')
    router.push('/login')
  }

  // to: '/inbox'
}]]
</script>

<template>
    <UDashboardLayout>
        <UDashboardPanel grow>
            <UDashboardNavbar>
                <template #left>

                </template>
                <template #center>
                    <div class="flex gap-10">
                        <NuxtLink active-class="text-primary"
                            inactive-class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
                            to="/user/indexview">首页</NuxtLink>
                           <NuxtLink active-class="text-primary"
                            inactive-class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
                            to="/user/sportview">运动资讯</NuxtLink>
                        <NuxtLink active-class="text-primary"
                            inactive-class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
                            to="/user/personcenter">个人中心</NuxtLink>
                        <NuxtLink active-class="text-primary"
                            inactive-class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
                            to="/user/explore">探索</NuxtLink>
                        <NuxtLink active-class="text-primary"
                            inactive-class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
                            to="/user/historyview">个人历史</NuxtLink>
                    </div>
                </template>
                <template #right>
                    <UDropdown :items="items" class="text-blue-300">
                        <UButton icon="i-heroicons-plus" size="md" class="ml-1.5 rounded-full" />
                    </UDropdown>
                </template>
            </UDashboardNavbar>
            <UDashboardPanelContent class="bg-slate-50">
                <slot />
            </UDashboardPanelContent>
        </UDashboardPanel>
    </UDashboardLayout>
</template>